package com.example.lianxirenlist;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import java.util.ArrayList;
import java.util.List;

public class Add extends AppCompatActivity {
    ListShuJuKu helder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add);
        intiview();
    }
    private void intiview () {
        helder = new ListShuJuKu(this, "Persion", null, 1);
        EditText name=findViewById(R.id.edit_name);
        EditText phone=findViewById(R.id.edit_phone);
        EditText tel=findViewById(R.id.edit_phone1);
        Button button=findViewById(R.id.butt_add);
        DataBean bean=new DataBean();
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                bean.setName(name.getText().toString());
                bean.setPhone(phone.getText().toString());
                bean.setTel(tel.getText().toString());
                helder.interlist(bean);
                Intent intent=new Intent(Add.this,MainActivity.class);
                startActivity(intent);






            }
        });



    }
}